package com.jojo.jojomall.search.controller;

import com.jojo.jojomall.search.service.MallSearchService;
import com.jojo.jojomall.search.vo.SearchParam;
import com.jojo.jojomall.search.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: 魔法少女小夫
 * @Data: 2022/5/16
 * @Version:
 * @Description:商品检索接口
 */
@Controller
public class SearchControlle {
@Autowired
MallSearchService mallSearchService;


    @GetMapping("/list.html")
 public String listPage(SearchParam param, Model model){
        SearchResult result=  mallSearchService.search(param);
        model.addAttribute("result",result);
        return "list";
 }
}
